package com.juguo.charginganimation.repository;

import com.juguo.charginganimation.Bean.AppIdBean;
import com.juguo.charginganimation.Bean.BaseBean;
import com.juguo.charginganimation.Bean.FavoritesBean;
import com.juguo.charginganimation.Bean.FavoritesListBean;
import com.juguo.charginganimation.Bean.HelpResponseBean;
import com.juguo.charginganimation.Bean.PhotoBean;
import com.juguo.charginganimation.Bean.PrivacyBean;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface PixabayService {

    @POST("user/login")
    Observable<BaseBean> login(@Body RequestBody body);

    /**
     * @param 设置请求头 @Header("Authorization")<-看接口 =Authorization    变 量名随便写->String auth
     * @param bean  请求体 一般为@Body json，可以传实体类，也可以用map，用map就写RequestBody
     * @return
     */
    //瀑布流
    @POST("res-ext/list")
    Observable<PhotoBean> getList(@Body RequestBody bean);

    //隐私政策
    @GET("app/last-v")
    Observable<PrivacyBean> getPrivacy();

    // 帮助反馈
    @POST("feedback/")
    Observable<HelpResponseBean> getfeedBack(@Body RequestBody body);

    //收藏动画
    @POST("res/{resId}/{starType}/")
    Observable<FavoritesBean> favoritesImages(
            @Path("resId") String resId
            , @Path("starType") int starType);

    //取消收藏动画
    @POST("res/{resId}/{starType}/")
    Observable<FavoritesBean> deleFavoritesImages(
            @Path("resId") String resId
            , @Path("starType") int starType);

    //获取收藏列表
    @POST("res-ext/star-list")
    Observable<FavoritesListBean> favoritesListBean(@Body RequestBody bean);

    @POST("res/star/batch")
    Observable<BaseBean> deleteFavoritesList(@Body RequestBody bean);

    //根据APPid获取信息
    @GET("app/appid/{appId}")
    Observable<AppIdBean> getAppIdAdvertise( @Path("appId") String appId);

}
